//
//  PLMObject.h
//  PlanTechFoundation
//
//  Created by ruifeng song on 2018/5/17.
//  Copyright © 2018年 srf. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <objc/runtime.h>

@protocol  IPTMObject <NSObject>

+(nullable instancetype)serializeWithJsonObject:(nullable NSDictionary *)jsonObj;
-(nullable instancetype)initWithJsonObject:(nullable NSDictionary *)jsonObj;
-(nonnull NSDictionary *)toJsonObject;

@end

@interface PTMObject : NSObject<IPTMObject,NSCopying,NSCoding>

+(nullable instancetype)serializeWithJsonObject:(NSDictionary *)jsonObj;
+(nullable NSMutableArray *)serializeWithJsonObjects:(nullable NSArray *)jsonObjects;

-(nullable instancetype)init;
-(nullable instancetype)initWithJsonObject:(NSDictionary *)jsonObj;
-(nonnull NSDictionary *)toJsonObject;

@end

#define PT_Generic_Custom_Array_Class_Define(__className) \
\
@protocol __className<NSObject>\
\
@end \

#define PT_Generic_Custom_Array_Class_Implement(__className) // Do nothing

#define PTMObjectArray(__className)      NSArray<__className *><__className>
#define PTMObjectMutableArra(__className)  NSMutableArray<__className *><__className>
